/*----------------------------------------------------------------------------*/
/* Mark Liu
/* DriverStation_IO.java
/* PSoC methods for I/O
/*----------------------------------------------------------------------------*/

package logomotion_2011;
import edu.wpi.first.wpilibj.DriverStationEnhancedIO;
import edu.wpi.first.wpilibj.DriverStation;

public class DriverStation_IO {

    public static DriverStationEnhancedIO io = DriverStation.getInstance().getEnhancedIO();

    public static boolean getDigital(int port) {
        try {                                 //You need to catch an exception
            return io.getDigital(port);       //Return the state of the digital input
        } catch(Exception e) {                //An exception will be thrown if the board is not plugged in
            e.printStackTrace();              //If an exception is thrown, print exception data
            return false;                     //and return false
        }
    }
    
}
